#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2025/5/14 16:11
# @Author  : XH
# @File    : handle_json.py
# @Software: PyCharm
# 定义工具函数，读取json文件中的数据，转换成 [(),(),()] 格式数据
import json

from common.handle_path import CONF_DIR


def read_json_data(filename):
    with open(filename, "r", encoding="utf8") as f:
        json_data = json.load(f)
        login_list = []
        for data in json_data:
            tmp = tuple(data.values())
            login_list.append(tmp)

        return login_list


if __name__ == '__main__':
    # res = read_json_data("../data/login_data.json")
    filename = CONF_DIR + "/login_data.json"
    res = read_json_data(filename)
    print(res)
